package edu.zli.lazy;

import java.lang.reflect.Constructor;

/**
 * @Desc
 * @Author Zerlinda
 * @Date 2022/5/7 8:54
 * @Version 1.0
 *
 *
 * 反射破坏单例
 */
public class LazyReflectTest {
    public static void main(String[] args) {
        try {
            Class<?> clazz = LazyStaticInnerClassSingle.class;
            Constructor constructor = clazz.getDeclaredConstructor(null);

            constructor.setAccessible(true);
            Object instance1 = constructor.newInstance();

            Object instance2 = constructor.newInstance();

            System.out.println(instance1);
            System.out.println(instance2);

        } catch(Exception e) {
            e.printStackTrace();
        }
    }
}
